package main

import (
	"fmt"
	"strconv"
)

func main() {
	var a int8 = 10
	aInt := int32(a)	//强制类型转换
	fmt.Println("aInt =", aInt)
	//字符串转数字
	str := "123"
	data, err := strconv.ParseInt(str, 10, 64) //转换为64位10进制整数
	if err != nil {
		fmt.Println("parse int error.", err)
	} else {
		fmt.Println("data is :", data)
	}
}
